package com.jqb.servlet;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class NoCookie extends HttpServlet {
	private static final long serialVersionUID = 1L;
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		/*解决用户禁用浏览器Cookie后的Session处理*/
		/*解决方案：URL重写(原理是重写有的URL带有JSESSIONID)*/
		String url = "http://www.baidu.com";
		/*用于对sendReddirect方法后的Url地址进行重写*/
		response.encodeRedirectURL(url);
		/*用于对表单和超级连接的url地址的重写*/
		response.encodeURL(url);
	}
}
